package com.firexxx.vp.application.dto;

import com.firexxx.vp.domain.vp.VoicePrintModel;
import com.firexxx.vp.domain.vp.single.Age;
import com.firexxx.vp.domain.vp.single.Gender;
import lombok.Data;

/**
 * @description: TODO
 * @throws:
 * @author: zhuangzhang2
 * @date: 2019/12/25 09:08
 */
@Data
public class VPMatchDto {

    private String role;
    private String vpId;
    private String extendContent;
    private String hobby;
    private String sex;
    private String age;

    public static VPMatchDto from(VoicePrintModel vpModel) {
        VPMatchDto vpMatchDto = new VPMatchDto();

        vpMatchDto.vpId = vpModel.getVpId();
        if (vpModel.getVpFeature().getSex() == Gender.Female) {
            vpMatchDto.sex = "female";
        } else if (vpModel.getVpFeature().getSex() == Gender.Male) {
            vpMatchDto.sex = "male";
        }

        if (vpModel.getVpFeature().getAge() == Age.CHILD) {
            vpMatchDto.age = "child";
        } else if (vpModel.getVpFeature().getAge() == Age.MIDDLE) {
            vpMatchDto.age = "youth";
        } else if (vpModel.getVpFeature().getAge() == Age.OLD) {
            vpMatchDto.age = "old";
        }

        return vpMatchDto;
    }

}